<!DOCTYPE html>
<head>
	<meta charset="UTF-8">
	<title><if condition="$detail['title']"><{$detail['title']}></if></title><!--<{$opt['site_name']}>-->
	<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0,user-scalable=no">
	<meta name="description" content="<{$detail['seo_depict']}>">
	<meta name="keywords" content="<{$detail['seo_key']}>">
	<!--<link rel="stylesheet" href="__PUBLIC__/css/normalize.css" /> -->
	<!-- <link rel="stylesheet" href="__PUBLIC__/css/style_ng.css"> -->
	<link rel="stylesheet" href="__PUBLIC__/css/style_wx.css">
	<script src="__PUBLIC__/js/jquery-1.11.3.min.js"></script>
	<script src="__PUBLIC__/js/base64en_de.js"></script>
	<script src="__PUBLIC__/js/common.js"></script>
	<!-- <link rel="stylesheet" href="<{$source}>css/style_wx.css"> -->
</head>

<html>

<style>
body{
	background-color:#ffffff;
}
#middle_content .div_middle img{
		max-width:100%;
	}
#middle_content .div_middle{
	margin:5px;
	padding:8px;
	max-width: 580px;
	margin-right: auto;
	margin-left: auto;
}
p,strong{
	font-size: 14px;
	line-height: 30px;
	margin-bottom: 10px;
}
.share_article{
	width:70px;
	height:70px;
	background-image:url('/Public/img/share.png');
	position:fixed;
	right:5px;
	bottom:50px;
	background-size:100%;
	background-repeat:no-repeat
}
.share_article_position div{
	width:32%;
	display:inline-block;
	text-align:center;
	height:100px;
}
.share_article_position div a{
	float:none;
	display:inline-block;
	width:40px;
	height:40px;
	margin:0px;
	border-radius:20px;
	margin:10px 10px 5px 10px;
}
.share_article_position div span{
	font-size:12px;
	display:block
}
.shade{
	width:100%;
	height:100%;
	position:fixed;
	top:0px;
	z-index:2;
	opacity:0.5;
	background-color:#000000;
	display:none
}
.advertisement img{
	width:100%
}
.advertisement{
	text-align:center
}
.page {
  padding: 5px;
  margin-right: auto;
  margin-left: auto;
}
.ad_infocc23 {
  color: #5b94d0;
  text-align: center;
  width: 99%;
  border: 2px solid #ccc;
  margin: 20px 0 0 0;
  border-radius: 10px;
  border-top: 8px solid #2ebc82;
  padding-bottom: 20px;
}
#middle_content img{
	width:100%
}
#middle_content img[data-type="gif"]{
	width:auto;
}
.bottom_p{
	color:#ddd;
	width:100%;
	text-align: center;
	height:30px;
	font-size:16px;
	line-height: 30px;
	margin-top:10px;
}

</style>

<body id="middle_content">
	<div id="article_content_id">
		<{:htmlspecialchars_decode($detail['content'])}>
	</div>
	<p class="bottom_p">此文章来源于网络，如有侵权请联系本平台删除</p>
	<if condition="$qr['close_qr'] eq 1">
	<div class="page">
		<div class="baner_list">
			<div class="ad_baner">
				<div class="ad_infocc23">				
					<p class="ccp23"><{$opt['site_name']}>,省时省力</p>
					<div class="erweimakk">
					<if condition="!empty($code_img)">
						<img src="/<{$code_img}>" alt="二维码" style="width:100%">
						<else />
						<img src="<{:U('Login/show_code',array('url'=>$qrcode_url))}>" alt="二维码">
					</if>
					</div>
					<p>微信长按此图片,识别二维码</p>
				</div>
			</div>
		</div>
	</div>
	</if>

	<if condition="$level_judge  == 1 && !empty($notice['publish_picture'])">
		 <div style="width:100%" class="advertisement">
			<if condition="!empty($notice['publish_picture'])">
				<a href="javascript:top.location.href='<{$url}>'">
					<img src="<{$notice['publish_picture']}>" class="bn photo">
				</a>
			</if>
		</div> 
	</if>
	
	<div class="shade" onclick="shade_click()">
	
	</div>
	<div class="bdsharebuttonbox share_article_position" data-tag="share_1" style="display:none;position:fixed;bottom:0%;height:200px;background-color:#ffffff;z-index:5;width:100%" id="share_article">
		<div>
			<a class="bds_qzone" data-cmd="qzone" style="background-position:0px;background-image:url('/Public/img/qqkj.png');background-size:100%;"></a>
			<span>qq空间</span>
		</div>
		<div>
			<a class="bds_tsina" data-cmd="tsina" style="background-position:0px;background-image:url('/Public/img/xlwb.png');background-size:100%"></a>
			<span>新浪微博</span>
		</div>
		<div>
			<a class="bds_renren" data-cmd="renren" style="background-position:0px;background-image:url('/Public/img/renren.png');background-size:100%"></a>
			<span>人人网</span>
		</div>
		<div>
			<a class="bds_tqq" data-cmd="tqq" style="background-position:0px;background-image:url('/Public/img/txwb.png');background-size:100%"></a>
			<span>腾讯空间</span>
		</div>
		<if condition="is_weixin()">
			<div>
				<a class="bds_weixin" data-cmd="weixin" style="background-position:0px;background-image:url('/Public/img/weixintb.png');background-size:100%;height:40px;width:40px" onclick="$('#shareTips').show();$('.shade').hide();$('#share_article').hide();event.stopPropagation();"></a>
				<span>微信</span>
			</div>
		<else/>
		<div>
			<a class="bds_weixin" data-cmd="weixin" style="background-position:0px;background-image:url('/Public/img/weixintb.png');background-size:100%;height:40px;width:40px" ></a>
			<span>微信</span>
		</div>
		</if>
		<!-- <a class="bds_more" data-cmd="more">更多</a>  -->
	</div>
	
	<if condition="!empty($judge)">
		<div class="share_article" onclick="share_click()"></div>
	</if>
	<div id="shareTips" style="display:none;position: fixed;height: 100%;width: 100%;top: 0;left: 0;background-color: rgba(0,0,0,0.7);">
		<img src="/Public/img/guide.png" alt="" style="position: absolute;top: 0;right: 0;">
		<div id="closeShareTips" style="position: absolute;bottom: 10px;color: #fff;width: 80px;border: 1px solid #fff;text-align: center;height: 30px;line-height: 30px;left: 50%;margin-left: -40px;cursor: pointer;">关闭</div>
	</div>
</body>
</html>
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	<if condition="$detail['share_img'] neq ''">
		var img = '<{$attachurl}><{$detail['share_img']}>';
	<else />
	//循环拿取图片
	var search = function (){
		var img = '';

		for(var a = 0;a<$("#article_content_id").find("img").length;a++){
			img = $("#article_content_id").find("img").eq(a).attr('src');
			if(img != '' && img != undefined){
				return img;
			}
		}
	}


	var img = search();
	if(img == '' || img == undefined){
		img = '<{$attachurl}>/Public/img/weixin.png';
	}

	</if>
	wx.config({
		//debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		appId: "<{$jsapi['appId']}>", // 必填，公众号的唯一标识
		timestamp: <{$jsapi['timestamp']+0}>, // 必填，生成签名的时间戳
		nonceStr: "<{$jsapi['nonceStr']}>", // 必填，生成签名的随机串
		signature: "<{$jsapi['signature']}>",// 必填，签名，见附录1
		jsApiList: [
			'onMenuShareTimeline',
			'onMenuShareAppMessage',
		] // 必填，需要使用的JS接口列表，所有JS接口列表见附录2
	});
	wx.ready(function(){
		wx.onMenuShareTimeline({
			title: '<{$detail['title']}>', // 分享标题
			link: '<{$share_url}>', // 分享链接
			imgUrl: img, // 分享图标
			success: function () {
				// 用户确认分享后执行的回调函数
			},
			cancel: function () {
				// 用户取消分享后执行的回调函数
			}
		});

		wx.onMenuShareAppMessage({
			title: '<{$detail['title']}>', // 分享标题
			desc: '<{$detail['share_summary']?$detail['share_summary']:$detail['title']}>', // 分享描述
			link: '<{$share_url}>', // 分享链接
			imgUrl: img, // 分享图标
			type: '', // 分享类型,music、video或link，不填默认为link
			dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
			success: function () {
				// 用户确认分享后执行的回调函数
			},
			cancel: function () {
				// 用户取消分享后执行的回调函数
			}
		});
	});

</script>
<script>
	$(function(){
		//音乐播放
		document.getElementById('media_tym').play();
		var window_width = $(document.body).width();
		
		
		//视频适应
		iframe_control();
		video_adapt();
		
		
		var length = $('img').length;
        //替换图片
		if(length){
			for(var a = 0;a< length;a++){
				var src  = $('img').eq(a).attr('data-src');
				//var width = $('img').eq(a).width();
			
				
				if(src){
					//匹配链接中是否有gif，有就gif类型
					var judge = src.search(/=gif/);
					if(judge != '-1'){
						 $('img').eq(a).css('width','auto');
					}
				}
				
				//判断宽度,自建文章会贴合边,not是悬浮图片的标识
				//if(width == window_width && !$('img').eq(a).hasClass('not')){
					//$('img').eq(a).css('width','95%');
				//}
				
			}
		};
		
		var isWeixinShare = false;
		//得到分割的cookie名值对 
		var cookieArray=document.cookie.split("; "); 
		for (var i=0;i<cookieArray.length;i++) {    
			//将名和值分开
			var arr=cookieArray[i].split("=");
			//如果是指定的cookie，则返回它的值    
			if (arr[0]=='weixin_share') {
				isWeixinShare = unescape(arr[1]);
			}
		}
		// console.log(isWeixinShare);
		if (isWeixinShare == '1' && <?php if (is_weixin()) { echo 'true';}else{ echo 'false';} ?>) {
			// console.log('Show TIPS');
			$('#shareTips').show();
		};
		// 设置为 NULL，避免重复
		document.cookie = 'weixin_share = null; path=/';
		
		$('#closeShareTips').click(function() {
			$('#shareTips').hide();
		});
	});
	//删除图片
	function delete_img(obj){
		$(obj).parent().remove();
		event.stopPropagation(); 
		return false;
	}


	window._bd_share_config = {
			common : {
				bdText : '',
				bdDesc : "<{$detail['share_summary']}>",
				bdUrl : '<{$share_url}>',
				bdPic : img
			},

			share : [{
				"bdSize" : 32
			}],
			selectShare : [{
				"bdselectMiniList" : ['qzone','tqq','kaixin001','bdxc','tqf']
			}]
		}
	with(document)0[(getElementsByTagName('head')[0]||body).appendChild(createElement('script')).src='http://bdimg.share.baidu.com/static/api/js/share.js?cdnversion='+~(-new Date()/36e5)];

	//点击分享文章
	function share_click(){
		if($("#share_article").is(":hidden")){
			$('.shade').show();
			
			$("#share_article").slideDown('normal',function (){
				$("#share_article").show();
			});
		}else{
			$('.shade').hide();
			$("#share_article").slideUp('normal',function (){
				$("#share_article").hide();
			});
		}
	}
	
	//阴影点击
	function shade_click(){
		$('.shade').hide();
		$("#share_article").slideUp('normal',function (){
			$("#share_article").hide();
		});
	}

	
</script>
